<?php
$this->breadcrumbs=array(
	'Competency Units'=>array('index'),
	$model->COMP_UNIT_CODE,
);

$this->menu=array(
	array('label'=>'List CompetencyUnit', 'url'=>array('index')),
	array('label'=>'Create CompetencyUnit', 'url'=>array('create')),
	array('label'=>'Update CompetencyUnit', 'url'=>array('update', 'id'=>$model->COMP_UNIT_CODE)),
	array('label'=>'Delete CompetencyUnit', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->COMP_UNIT_CODE),'confirm'=>'Are you sure you want to delete this item?')),
	array('label'=>'Manage CompetencyUnit', 'url'=>array('admin')),
);
?>

<h1>View CompetencyUnit #<?php echo $model->COMP_UNIT_CODE; ?></h1>

<?php 
	$this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		'COMP_UNIT_CODE',
		'COMP_UNIT_NAME',
		'COMP_UNIT_DESC',
	),
)); ?>


<br/>



<h2>List CompetencyElement #<?php echo $model->COMP_UNIT_CODE; ?></h2>
<?php echo CHtml::link('Create Element',array('competencyElement/create'))?>


<?php

$this->widget('zii.widgets.grid.CGridView', array(
    'dataProvider'=>$model->getElementId($_GET['id']),
    'columns'=>array('COMP_ELEM_CODE',
		'COMP_UNIT_CODE',
		'COMP_ELEM_NAME',
		'COMP_ELEM_DESC',),
));

/*


$this->widget('zii.widgets.CListView', array(
	'dataProvider'=>$element,
	'itemView'=>'_viewElement',
));

$rowEl = $model->getUnitElement($model->COMP_UNIT_CODE);

foreach($rowEl as $key=>$val)
{
	echo "</br><table>
		<tr>
			<td>Element Code </td>
			<td> : " .CHtml::link("$key",array('competencyElement/view','id'=>$key))."</td>
		</tr>
		<tr>	<td>Element Name </td>
			<td> : $val</td>
		</tr>
		</table>";

}

$this->widget('zii.widgets.grid.CGridView', array(
	'dataProvider' => $model->search2(),
	'filter' => $model,
	'columns' => array(
		array(
			'name' => 'COMP_ELEM_CODE',
			'type' => 'raw',
			'value' => 'CHtml::encode($data->COMP_ELEM_CODE)'
		),
		array(
			'name' => 'COMP_ELEM_NAME',
			'type' => 'raw',
			'value' => 'CHtml::link(CHtml::encode($data->COMP_ELEM_NAME), "mailto:".CHtml::encode($data->COMP_ELEM_NAME))',
		),
	),
));
*/

?>
